home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1627 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: oxy.rust.net!usenet
  2. From: ebennett@rust.net
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Why can't I use this function prototype????
  5. Date: Fri, 12 Jan 1996 03:06:36 GMT
  6. Organization: Rust Net - High Speed Internet in Detroit  810-642-2276
  7. Message-ID: <4d48kb$qb9@oxy.rust.net>
  8. References: <60ju5934@kbrady.ultranet.com>
  9. NNTP-Posting-Host: liv-13.rust.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Ken Brady <kbrady@ultranet.com> wrote:
  13.  
  14. >I have a header file with something like: 
  15. >/*  pm_app.hpp */ 
  16. >Class PmApplication { 
  17. >  PmApplication();
  18. >  .... //member and method definitions here 
  19. >}; 
  20. >PmApplication *Application();    //a typical function prototype?? 
  21. >// other function prototypes here 
  22. >// end pm_app.hpp 
  23. >My implementation is, of course, hidden from users of the header file: 
  24. > Stuff Deleted...
  25. >
  26. >void MyProcedure()  
  27. >{ ... 
  28. >  PmApp *A=Application();        //won't compile!! 
  29. >  ... 
  30. >} 
  31.  
  32.  
  33. I suspect the problem is simply that the statement:
  34.  
  35.   PmApp *A = Application();
  36.  
  37. should be
  38.  
  39.   PmApplication *A = Application();
  40.  
  41. The compiler has not seen a prototype for a function called
  42. Application() which returns a pointer to a PmApp object.
  43.  
  44. Earl Bennett
  45.  
  46.  
  47.  
  48.  
  49.  
  50.